﻿@model Infinity.BusinessLayer.CourseViewModel
@using Infinity.Models;
@using Infinity.BusinessLayer;

@{
    ViewBag.Title = "NewCourse";
    Layout = "~/Areas/Managerial/Views/Shared/_AdminLayout.cshtml";
}

<link href="backToTop/totop.css" rel="stylesheet" type="text/css" />

<span style="color:red">
    @Html.ValidationSummary()
</span>
<section class="course-form">
    <h2> <strong>Add New Course</strong></h2>
    @Html.ActionLink("Back to List", "Index", null, new { @class = "send" })

    @using (Html.BeginForm("NewCourse", "Course"))
    {

        @Html.AntiForgeryToken()
        @Html.ValidationSummary(true)

        <span class="input input--jiro">
            <label class="" for="input-10" style="color:gray">
                <span class="input__label-content input__label-content--jiro">
                    &nbsp;&nbsp; @Html.HiddenFor(model => model.CourseID)
                    Course ID
                    &nbsp;&nbsp;&nbsp;
                    @Model.CourseID
                </span>
            </label>
        </span>
        <br />
        <div >
            <span class="input input--jiro">
                <input class="input__field input__field--jiro" type="text" name="Course_Name" id="Course_Name" />
                <label class="input__label input__label--jiro" for="input-21">
                    <span class="input__label-content input__label-content--jiro">
                        Course Name
                        @*@Html.ValidationMessageFor(model => model.Course_Name)*@
                    </span>
                </label>
            </span>
        </div>
        <br />
        <div >
            <span class="input input--jiro">
                <select class="input__field input__field--jiro" id="CategoryID" name="CategoryID">
                    @foreach (var item in ViewBag.catList)
                        {
            <option value="@item.CategoryID">@item.Category_Name</option>
                        }
                </select>

                <label class="input__label input__label--jiro" for="input-19">
                    <span class="input__label-content input__label-content--jiro">Category</span>
                </label>
            </span>
        </div>
        <br />
        <span class="input input--jiro">
            <input class="input__field input__field--jiro" type="text" name="Official_crs_hrs" id="Official_crs_hrs" />
            <label class="input__label input__label--jiro " for="input-10">
                <span class="input__label-content input__label-content--jiro">
                    Number of Hours
                </span>
            </label>
        </span>
        <br />
       <div>
            <span class="input input--jiro">
            <label class="" for="input-10" style="color:gray">
                <span class="input__label-content input__label-content--jiro">
                    &nbsp;&nbsp;
                    Certificate
                    &nbsp;&nbsp;&nbsp;
                    <input type="checkbox" id="CheckCertificate" />
                </span>
            </label>
        </span>
       </div>
        <span class="input input--jiro">
            <input class="hideCertificate input__field input__field--jiro" type="text" name="Certificate" id="Certificate" />
            <label class="hideCertificate input__label input__label--jiro " for="input-10">
                <span class="input__label-content input__label-content--jiro">
                    Certificate Price
                </span>
            </label>
        </span>
        <br />
    
        <div>
            <span class="input input--jiro">
            <label class="" for="input-10" style="color:gray">
                <span class="input__label-content input__label-content--jiro">
                    &nbsp;&nbsp;
                    Material
                    &nbsp;&nbsp;&nbsp;
                    <input type="checkbox" id="CheckMaterial" />
                </span>
            </label>
        </span>
       
        </div>
        <span class="input input--jiro">
            <input class="hideMaterial input__field input__field--jiro" type="text" name="Material" id="Material" />
            <label class="hideMaterial input__label input__label--jiro " for="input-10">
                <span class="input__label-content input__label-content--jiro">
                    Material Price
                </span>
            </label>
        </span>
        <br />
        <span class="input input--jiro">
            <label class="" for="input-10" style="color:gray">
                <span class="input__label-content input__label-content--jiro">
                    &nbsp;&nbsp;
                    Exam
                    &nbsp;&nbsp;&nbsp;
                    @Html.CheckBoxFor(model => model.Exam)
                </span>
            </label>
        </span>
       
   

@*<input type="button" id="AddOutline" value="Add New">*@

<div role="tabpanel" class="padding-90">

    <!-- Nav tabs -->
    <ul class="nav nav-tabs" role="tablist">
        <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">Course Price</a></li>
        <li role="presentation"> <a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">Course Outline</a></li>

    </ul>

    <!-- Tab panes -->
    <div class="tab-content">
        <div role="tabpanel" class="tab-pane active" id="home">
            
                @foreach (var item in Model.course_grouptype)
                {
                    Html.RenderPartial("_course_grouptype", item);
                }
            <div class="col-md-12 text-center send3">
                <a href="#" class="send">ADD</a>
            </div>
        </div>


        <div role="tabpanel" class="tab-pane" id="profile">
            <div class="row">
                <div id="outLine">
                    @foreach (var item in Model.Outlines)
                    {
                        Html.RenderPartial("_Outline", item);
                    }
                </div>
                <br>
                <div class="col-md-12 text-center send3">
                    <a href="#" class="send">ADD</a>
                </div>
            </div>
            
        </div>


    </div>

   
</div>
         <p><input type="submit" class="send" value="Create" /> </p>
         }
</section>

<script>
    $(document).ready(function () {
        
        $(".hideMaterial").hide();
        $(".hideCertificate").hide();
        x();
        function x() {
            $("#CheckMaterial").click(function () {

                if ($("#CheckMaterial").is(":checked")) {

                    $(".hideMaterial").show();
                }
                else {
                   
                    $(".hideMaterial").hide();
                }
            })
            $("#CheckCertificate").click(function () {
                if ($("#CheckCertificate").is(":checked")) {
                    $(".hideCertificate").show();

                }
                else { $(".hideCertificate").hide(); }
            })
        }
    })
</script>

